﻿using Jacobi.Vst.Core;
using Jacobi.Vst.Core.Host;
using Jacobi.Vst.Interop.Host;

namespace Play.VstPluginManagement
{
	public class VstPluginFactory
	{
		private readonly IVstHostCommandStub _vstHostCommandStub;

		public VstPluginFactory(IVstHostCommandStub vstHostCommandStub)
		{
			_vstHostCommandStub = vstHostCommandStub;
		}

		public VstPluginContext Create(VstPluginInfo pluginPath)
		{
			var pluginContext = VstPluginContext.Create(pluginPath.Path, _vstHostCommandStub);
			pluginContext.PluginCommandStub.SetEditorKnobMode(VstKnobMode.LinearMode);
			return pluginContext;
		}
	}
}